<template>
  
  <div class="page-container">
    <!-- 搜索栏 -->
    <el-card class="search-card" shadow="hover">
      <el-form :model="queryOrder" inline>
        <el-form-item label="订单号">
          <el-input
            v-model="queryOrder.orderNumber"
            placeholder="请输入订单号"
            clearable
            @keyup.enter="handleSearch"
          />
        </el-form-item>
        <el-form-item label="用户名">
          <el-input
            v-model="queryOrder.uname"
            placeholder="请输入用户名"
            clearable
            @keyup.enter="handleSearch"
          />
        </el-form-item>
        <el-form-item label="配送员">
          <el-input
            v-model="queryOrder.dname"
            placeholder="请输入配送员姓名"
            clearable
            @keyup.enter="handleSearch"
          />
        </el-form-item>

        <el-form-item label="订单状态">
          <el-select
            v-model="queryOrder.status"
            placeholder="请选择状态"
            clearable
          >
            <el-option label="待分配" value="0" />
            <el-option label="已分配" value="1" />
            <el-option label="配送中" value="2" />
            <el-option label="已完成" value="3" />
            <el-option label="已取消" value="4" />
            <el-option label="已支付" value="5" />
          </el-select>
          <p>当前选择的状态值：{{queryOrder.status}} (类型：{{typeof queryOrder.status}})</p>
        </el-form-item>

          <el-form-item label="注册时间">
            <el-date-picker
                v-model="queryOrder.startRegisterTime"
                type="date"
                placeholder="开始日期"
                format="YYYY-MM-DD"
            />
            <span class="date-separator">至</span>
            <el-date-picker
                v-model="queryOrder.endRegisterTime"
                type="date"
                placeholder="结束日期"
                format="YYYY-MM-DD"
            />
          </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="handleSearch">
            <el-icon><Search /></el-icon>
            搜索
          </el-button>
          <el-button @click="resetSearch">
            <el-icon><Refresh /></el-icon>
            重置
          </el-button>
        </el-form-item>
      </el-form>


    </el-card>

    <!-- 订单列表 -->
    <el-card class="table-card" shadow="hover">
      <template #header>
        <div class="card-header">
          <span>订单列表</span>
          <div class="header-actions">
            <el-button type="success" @click="handleExport">
              <el-icon><Download /></el-icon>
              导出订单
            </el-button>
          </div>
        </div>
      </template>

      <!-- 订单卡片网格 -->
      <div class="order-list-grid">
        <div v-for="order in orderData" :key="order.orderNumber" class="order-list-card">
          <!-- 顶部状态色条 -->
          <div class="order-card-status-bar" :style="{ background: getStatusBarColor(order.status) }"></div>
          <div class="order-card-main">
            <!-- 左区：订单号、金额、状态 -->
            <div class="order-card-main-left">
              <div class="order-card-no">
                <el-icon style="vertical-align: middle; margin-right: 4px;"><Document /></el-icon>
                <span>{{ order.orderNumber }}</span>
              </div>
              <div class="order-card-amount">
                <span>¥{{ order.jiage }}</span>
              </div>
              <el-tag :type="getStatusType(order.status)" class="order-card-status">
                {{ getStatusText(order.status) }}
              </el-tag>
            </div>
            <!-- 右区：详细信息 -->
            <div class="order-card-main-right">
              <div class="order-card-info-row">
                <span class="order-card-label">用户：</span>{{ order.uname }}
              </div>
              <div class="order-card-info-row">
                <span class="order-card-label">配送员：</span>{{ order.dname }}
              </div>
              <div class="order-card-info-row">
                <span class="order-card-label">创建：</span>{{ order.createdAt }}
              </div>
              <div class="order-card-info-row">
                <span class="order-card-label">完成：</span>{{ order.deliveryTime || '-' }}
              </div>
            </div>
          </div>
          <!-- 操作按钮 -->
          <div class="order-card-actions">
            <el-button type="primary" class="order-btn" link @click="handleViewDetail(order)">
              <el-icon><View /></el-icon> 查看详情
            </el-button>
            <el-button
              v-if="order.status === 'pending'"
              type="success"
              class="order-btn"
              link
              @click="handleAssignDeliveryman(order)"
            >
              <el-icon><User /></el-icon> 分配配送员
            </el-button>
          </div>
        </div>
      </div>

      <!-- 分页 -->
      <div class="pagination-container">
        <el-pagination
          v-model:current-page="queryOrder.current"
          v-model:page-size="queryOrder.size"
          :page-sizes="[3, 6, 9, 12]"
          :total="queryOrder.total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </el-card>

    <!-- 订单详情对话框 -->
    <el-dialog
      title="订单详情"
      v-model="detailVisible"
      width="600px"
      :close-on-click-modal="false"
    >
      <el-descriptions :column="2" border>
        <el-descriptions-item label="订单号">{{ currentOrder.orderNumber }}</el-descriptions-item>
        <el-descriptions-item label="订单状态">
          <el-tag :type="getStatusType(currentOrder.status)">
            {{ getStatusText(currentOrder.status) }}
          </el-tag>
        </el-descriptions-item>
        <el-descriptions-item label="用户名">{{ currentOrder.uname }}</el-descriptions-item>
        <el-descriptions-item label="配送员">{{ currentOrder.dname }}</el-descriptions-item>
        <el-descriptions-item label="订单金额">¥{{ currentOrder.jiage }}</el-descriptions-item>
        <el-descriptions-item label="配送地址">{{ currentOrder.zhongdian }}</el-descriptions-item>
        <el-descriptions-item label="创建时间">{{ currentOrder.createdAt }}</el-descriptions-item>
        <el-descriptions-item label="完成时间">{{ currentOrder.deliveryTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="备注" :span="2">{{ currentOrder.notes || '-' }}</el-descriptions-item>
      </el-descriptions>
    </el-dialog>

    <!-- 分配配送员对话框 -->
    <el-dialog
      title="分配配送员"
      v-model="assignVisible"
      width="500px"
      :close-on-click-modal="false"
    >
      <el-form
        ref="assignFormRef"
        :model="assignForm"
        :rules="assignRules"
        label-width="80px"
      >
        <el-form-item label="配送员" prop="deliverymanId">
          <el-select
            v-model="assignForm.deliverymanId"
            placeholder="请选择配送员"
            style="width: 100%"
          >
            <el-option
              v-for="item in availableDeliverymen"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            >
              <span>{{ item.name }}</span>
              <span class="deliveryman-info">
                ({{ item.phone }} - {{ getStatusText(item.status) }})
              </span>
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="assignVisible = false">取消</el-button>
          <el-button
            type="primary"
            @click="submitAssign"
            :loading="submitting"
          >
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 图片网格布局 -->
    <div class="image-grid">
      <div v-for="(image, index) in images" :key="index" class="grid-item">
        <!-- 添加点击事件 -->
        <img :src="`/src/assets/img/${image}`" :alt="'配送员背景图 ' + (index + 1)" class="grid-image" @click="handleImageClick(index)">
        <div class="image-overlay">
          <span>{{ getImageTitle(index) }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive } from 'vue'
// 导入 useRouter
import { useRouter } from 'vue-router'

const router = useRouter()

import { ElMessage } from 'element-plus'
import {
  Search,
  Refresh,
  Download,
  View,
  User,
  Document
} from '@element-plus/icons-vue'
import {adminOrder} from "@/assets/admin.js";
import * as XLSX from 'xlsx'

// 搜索表单
const searchForm = reactive({
  orderNo: '',
  username: '',
  deliverymanName: '',
  status: '',
  dateRange: []
})

const queryOrder = ref({
  current:1,
  size:4,
  total:0,
  orderNumber:null,
  uname:null,
  dname:null,
  status:'',
  startRegisterTime:null,
  endRegisterTime:null,
})
const currentOrder = ref({
  orderNumber:null,
  uname:null,
  dname:null,
  jiage:null,
  createdAt:null,
  deliveryTime:null,
  zhongdian:null,
  notes:null
})
const handelXqing = () =>{
  adminOrder(currentOrder.value).then(res=>{
    console.log(res.data)
  })
}
handelXqing()
const orderData = ref([])
const handelOrder = () =>{
  adminOrder(queryOrder.value).then(res=>{
    console.log(res.data)
    if (res.data.code == 200){
      orderData.value = res.data.data.records
      queryOrder.value.total = res.data.data.total
    }
  })
}
handelOrder()
// 表格数据
const loading = ref(false)
// const orderList = ref([
//   {
//     orderNo: 'DD202403150001',
//     username: '张三',
//     deliverymanName: '李四',
//     amount: 99.00,
//     status: 'pending',
//     address: '北京市朝阳区建国路88号',
//     createTime: '2024-03-15 10:30:00',
//     completeTime: null,
//     remark: '请尽快送达'
//   },
//   {
//     orderNo: 'DD202403150002',
//     username: '王五',
//     deliverymanName: '赵六',
//     amount: 199.00,
//     status: 'delivering',
//     address: '北京市海淀区中关村大街1号',
//     createTime: '2024-03-15 11:20:00',
//     completeTime: null,
//     remark: '请轻拿轻放'
//   },
//   {
//     orderNo: 'DD202403150003',
//     username: '钱七',
//     deliverymanName: '孙八',
//     amount: 299.00,
//     status: 'completed',
//     address: '北京市西城区西长安街1号',
//     createTime: '2024-03-15 12:15:00',
//     completeTime: '2024-03-15 13:30:00',
//     remark: '无'
//   }
// ])

// 分页
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(100)

// 订单详情
const detailVisible = ref(false)


// 分配配送员
const assignVisible = ref(false)
const assignFormRef = ref(null)
const assignForm = reactive({
  deliverymanId: ''
})

const assignRules = {
  deliverymanId: [
    { required: true, message: '请选择配送员', trigger: 'change' }
  ]
}

// 可用配送员列表
const availableDeliverymen = ref([
  {
    id: 1,
    name: '李四',
    phone: '13800138000',
    status: 'idle'
  },
  {
    id: 2,
    name: '赵六',
    phone: '13800138001',
    status: 'idle'
  }
])

// 提交状态
const submitting = ref(false)

// 状态相关方法
const getStatusType = (status) => {
  const statusMap = {
    0: '待分配',
    1: '已分配',
    2: '配送中',
    3: '已完成',
    4: '已取消',
    5: '已支付'
  }
  return statusMap[status]
}

const getStatusText = (status) => {
  const statusMap = {
    0: '待分配',
    1: '已分配',
    2: '配送中',
    3: '已完成',
    4: '已取消',
    5: '已支付'
  }
  return statusMap[status]
}

// 搜索
const handleSearch = () => {
  // TODO: 实现搜索功能
 queryOrder.value.current=1
  queryOrder.value.size = 3
  handelOrder()
}

// 重置搜索
const resetSearch = () => {
location.reload()
}

// 分页
const handleSizeChange = (val) => {
  queryOrder.value.current=1
  queryOrder.value.size = val
  handelOrder()
}

const handleCurrentChange = (val) => {
  queryOrder.value.current=val
  handelOrder()
}

// 查看订单详情
const handleViewDetail = (row) => {
  currentOrder.value = row
  detailVisible.value = true
}

// 分配配送员
const handleAssignDeliveryman = (row) => {
  currentOrder.value = row
  assignForm.deliverymanId = ''
  assignVisible.value = true
}

const submitAssign = async () => {
  if (!assignFormRef.value) return

  await assignFormRef.value.validate((valid) => {
    if (valid) {
      submitting.value = true
      // TODO: 实现分配配送员功能
      setTimeout(() => {
        submitting.value = false
        assignVisible.value = false
        ElMessage.success('分配成功')
      }, 1000)
    }
  })
}

// 导出订单
const handleExport = () => {
  if (!orderData.value || orderData.value.length === 0) {
    ElMessage.warning('没有可导出的订单数据')
    return
  }
  const exportData = orderData.value.map(order => ({
    '订单号': order.orderNumber,
    '用户名': order.uname,
    '配送员': order.dname,
    '金额': order.jiage,
    '状态': getStatusText(order.status),
    '创建时间': order.createdAt,
    '完成时间': order.deliveryTime || '-',
    '备注': order.notes || '-'
  }))
  const ws = XLSX.utils.json_to_sheet(exportData)
  const wb = XLSX.utils.book_new()
  XLSX.utils.book_append_sheet(wb, ws, '订单列表')
  XLSX.writeFile(wb, '订单列表.xlsx')
  ElMessage.success('订单Excel已导出')
}

// 图片标题数组 - 根据您的实际需求修改
const imageTitles = [
  '冷链配送',
  '美妆护肤',
  '服装鞋帽',
  '家具家电',
  '医疗保健',
  '汽车用品',
  '食品饮料',
  '宠物用品',
  '3CE数码',
  '鲜蔬配送'
]

// 获取图片标题的方法
const getImageTitle = (index) => {
  return imageTitles[index % imageTitles.length] || `配送服务 ${index + 1}`
}

// 确保图片数组至少有 6 张图片
const images = ref([
  '生鲜.png',
  '美妆护肤图片生成.png',
  '服装图片.png',
  '家具家电图片.png',
  '医疗保健用品.png',
  '汽车用品.png',
  '生成食品饮料图片.png',
  '宠物用品图片.png',
  '生成 3C 数码图片.png',
  '果蔬.png'
]);

// 解析图片路径
const resolveImagePath = (imgPath) => {
  // 如果是网络图片直接返回
  if (imgPath.startsWith('http')) return imgPath;

  // 本地图片使用require或import方式加载
  try {
    return new URL(`/src/assets/img/${imgPath}`, import.meta.url).href;
  } catch (e) {
    console.error('加载图片失败:', imgPath);
    return '';
  }
};

// 添加点击事件处理函数
const handleImageClick = (index) => {
    router.push(`/style/${index}`)
}

// 订单状态渐变色条
const getStatusBarColor = (status) => {
  switch (status) {
    case 0: return 'linear-gradient(90deg, #ffb347, #ffcc33)'; // 待分配
    case 1: return 'linear-gradient(90deg, #4facfe, #00f2fe)'; // 已分配
    case 2: return 'linear-gradient(90deg, #43e97b, #38f9d7)'; // 配送中
    case 3: return 'linear-gradient(90deg, #667eea, #764ba2)'; // 已完成
    case 4: return 'linear-gradient(90deg, #f85032, #e73827)'; // 已取消
    case 5: return 'linear-gradient(90deg, #fa709a, #fee140)'; // 已支付
    default: return 'linear-gradient(90deg, #e0e0e0, #f5f5f5)';
  }
}

const getStatusDotColor = (status) => {
  switch (status) {
    case 0: return '#ffb347';
    case 1: return '#4facfe';
    case 2: return '#43e97b';
    case 3: return '#667eea';
    case 4: return '#f85032';
    case 5: return '#fa709a';
    default: return '#e0e0e0';
  }
}

</script>

<style scoped>
.page-container {
  padding: 32px;
  min-width: 900px;
  background-color: #f8f9fa; /* 浅灰色背景 */
}

.search-card {
  margin-bottom: 24px;
  border-radius: 22px !important;
  box-shadow: 0 6px 24px rgba(60,120,200,0.08), 0 1.5px 6px rgba(0,0,0,0.04);
  background: #fff;
  padding: 28px 32px 18px 32px !important;
  border: none;
  transition: box-shadow 0.3s;
}

.search-card:hover {
  box-shadow: 0 12px 36px rgba(60,120,200,0.13), 0 4px 16px rgba(0,0,0,0.10);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px 32px;
  justify-content: flex-start;
}

:deep(.el-form-item) {
  margin-bottom: 0 !important;
}

:deep(.el-input__wrapper),
:deep(.el-select .el-input__wrapper),
:deep(.el-date-editor.el-input__wrapper) {
  border-radius: 14px !important;
  background: #f7fafd;
  border: 1.5px solid #e3e8f0;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 40px;
}

:deep(.el-input__wrapper:hover),
:deep(.el-select .el-input__wrapper:hover),
:deep(.el-date-editor.el-input__wrapper:hover) {
  border-color: #a0c4ff;
}

:deep(.el-input__wrapper.is-focus),
:deep(.el-select .el-input__wrapper.is-focus),
:deep(.el-date-editor.el-input__wrapper.is-focus) {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64,158,255,0.08);
}

:deep(.el-input__inner),
:deep(.el-select__selected-item) {
  font-size: 15px;
  color: #222;
  background: transparent;
}

:deep(.el-select .el-input__inner) {
  padding-right: 28px;
}

:deep(.el-date-editor .el-input__inner) {
  padding-right: 28px;
}

:deep(.el-form-item__label) {
  color: #6b7a90;
  font-weight: 500;
  font-size: 15px;
  margin-right: 6px;
}

:deep(.el-button) {
  border-radius: 14px !important;
  font-size: 16px;
  font-weight: 500;
  height: 40px;
  min-width: 90px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(60,120,200,0.06);
}

:deep(.el-button--primary) {
  background: linear-gradient(90deg, #409eff 0%, #66b1ff 100%);
  color: #fff;
  border: none;
}

:deep(.el-button--primary:hover) {
  background: linear-gradient(90deg, #357ae8 0%, #409eff 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(64,158,255,0.13);
}

:deep(.el-button:not(.el-button--primary)) {
  background: #f7fafd;
  color: #409eff;
  border: 1.5px solid #e3e8f0;
}

:deep(.el-button:not(.el-button--primary):hover) {
  background: #f0f4fa;
  color: #357ae8;
}

:deep(.el-icon) {
  font-size: 20px;
  vertical-align: middle;
}

.date-separator {
  color: #b0b8c9;
  margin: 0 8px;
  font-size: 15px;
}

@media (max-width: 1200px) {
  .search-form {
    gap: 18px 12px;
  }
}
@media (max-width: 900px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px 0;
  }
  .search-card {
    padding: 18px 10px 10px 10px !important;
  }
}

.table-card {
  margin-bottom: 20px;
  border-radius: 16px; /* 增加圆角 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 增强阴影 */
  background-color: #ffffff; /* 白色背景 */
  transition: transform 0.3s ease;
}

.table-card:hover {
  transform: translateY(-4px); /* 悬停时上移 */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef; /* 分割线 */
}

.header-actions {
  display: flex;
  gap: 12px;
}

:deep(.el-table th) {
  background-color: #f1f3f5; /* 表头背景色 */
  color: #343a40; /* 表头文字颜色 */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

:deep(.el-table td) {
  color: #495057; /* 表格文字颜色 */
}

:deep(.el-table tr:hover td) {
  background-color: #f8f9fa; /* 悬停背景色 */
}

:deep(.el-tag) {
  border-radius: 16px; /* 标签圆角 */
  padding: 0 12px;
}

:deep(.el-button) {
  border-radius: 8px; /* 按钮圆角 */
}

:deep(.el-dialog) {
  border-radius: 16px; /* 对话框圆角 */
  overflow: hidden;
}

:deep(.el-dialog__header) {
  background-color: #f8f9fa; /* 对话框头部背景色 */
  border-bottom: 1px solid #e9ecef; /* 分割线 */
}

:deep(.el-descriptions) {
  background-color: #ffffff; /* 描述列表背景色 */
  border-radius: 12px; /* 描述列表圆角 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); /* 描述列表阴影 */
}

:deep(.el-descriptions__label) {
  color: #6c757d; /* 描述标签颜色 */
}

:deep(.el-descriptions__content) {
  color: #343a40; /* 描述内容颜色 */
}

.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.el-table {
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

:deep(.el-table th) {
  background: #f5f7fa;
  font-weight: 600;
  color: #606266;
}

:deep(.el-table td) {
  color: #606266;
}

:deep(.el-tag) {
  border-radius: 8px;
}

:deep(.el-button .el-icon) {
  margin-right: 4px;
}

:deep(.el-form--inline .el-form-item) {
  margin-right: 20px;
}

:deep(.el-dialog__body) {
  padding: 20px 30px;
}

:deep(.el-dialog__footer) {
  padding: 10px 30px 20px;
  border-top: 1px solid #ebeef5;
}

:deep(.el-descriptions) {
  padding: 20px;
  border-radius: 8px;
  background: #f5f7fa;
}

:deep(.el-descriptions__label) {
  width: 100px;
  color: #606266;
}

:deep(.el-descriptions__content) {
  color: #303133;
}

.deliveryman-info {
  color: #909399;
  margin-left: 8px;
  font-size: 12px;
}
.page-container {
  padding: 32px;
  min-width: 980px;
  background-color: #f8f9fa;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.grid-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  aspect-ratio: 4/3; /* 保持图片比例 */
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid-item:hover .image-overlay {
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 16px;
    min-width: auto;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
}

.order-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 36px;
  margin: 36px 0 10px 0;
}

.order-list-card {
  background: linear-gradient(135deg, #fafdff 70%, #e9f1fb 100%);
  border-radius: 22px;
  box-shadow: 0 6px 24px rgba(60,120,200,0.10), 0 1.5px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  min-height: 210px;
  position: relative;
  transition: box-shadow 0.3s, transform 0.2s;
  overflow: hidden;
}

.order-list-card:hover {
  box-shadow: 0 16px 48px 0 rgba(60,120,200,0.18), 0 4px 16px rgba(0,0,0,0.10);
  transform: translateY(-6px) scale(1.025);
}

.order-card-status-bar {
  height: 6px;
  width: 100%;
  border-radius: 22px 22px 0 0;
  margin-bottom: 0;
}

.order-card-main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 24px 28px 10px 28px;
  gap: 18px;
}

.order-card-main-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 120px;
  gap: 12px;
}

.order-card-no {
  font-weight: bold;
  color: #1a2233;
  font-size: 17px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}

.order-card-amount {
  color: #e74c3c;
  font-size: 22px;
  font-weight: bold;
  margin-top: 2px;
}

.order-card-status {
  font-size: 15px;
  border-radius: 14px;
  padding: 3px 18px;
  font-weight: 600;
  margin-top: 6px;
}

.order-card-main-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  flex: 1;
}

.order-card-info-row {
  color: #4a5a6a;
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  align-items: center;
}

.order-card-label {
  color: #7b8ba6;
  font-weight: 500;
  margin-right: 4px;
  min-width: 56px;
  display: inline-block;
}

.order-card-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 12px 0 18px 0;
  border-top: 1px solid #f0f3fa;
  background: rgba(255,255,255,0.7);
}

.order-btn {
  font-size: 16px;
  font-weight: 500;
  border-radius: 18px;
  padding: 0 18px;
  height: 38px;
  background: linear-gradient(90deg, #f5f7fa 0%, #e9f1fb 100%);
  color: #2d3a4b;
  border: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(60,120,200,0.06);
}

.order-btn:hover {
  background: linear-gradient(90deg, #409eff 0%, #66b1ff 100%);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(64,158,255,0.13);
}

@media (max-width: 900px) {
  .order-list-grid {
    grid-template-columns: 1fr;
  }
  .order-card-main {
    flex-direction: column;
    gap: 10px;
    padding: 18px 12px 6px 12px;
  }
  .order-card-main-left {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    min-width: 0;
  }
  .order-card-main-right {
    gap: 4px;
  }
}
</style>

